﻿using Sidvall.Net;
using System.Threading.Tasks;

namespace Sidvall.Security
{
    public interface IAuthenticationStrategy
    {
        AuthenticationHeader CurrentAuthenticationHeader { get; set; }
        TokenItem TokenItem { get; }
        bool TokenItemIsLoaded { get; }

        Task LoadAuthenticationHeaderAsync(TokenResponse tokenResponse, bool storeInFile);

        void LoadTokenItem(string content);
        void LoadTokenItem(TokenItem tokenItem);
        Task LoadTokenItemAsync(bool refresh);

        Task<bool> NewAuthenticationHeaderFromRefreshTokenAsync();
        Task<bool> NewAuthenticationHeaderFromResourceOwnerPasswordAsync(string userName, string password, string scope);
    }
}
